
dy-lib=libmymethod.so
static-lib=libmath.a
.PHONY:all
all:$(dy-lib) $(static-lib)

$(static-lib):mymath.o
	ar -rc $@ $^
$(dy-lib):mylog.o myprint.o
	gcc -shared -o  $@ $^
mylog.o: mylog.c
	gcc -fPIC -c $^
myprint.o:myprint.c
	gcc -fPIC -c $^
mymath.o:mymath.c
	gcc -c  $^
.PHONY:clean
clean:
	rm -rf *.a *.o *.so mylib
.PHONY:out
out:
	mkdir -p mylib/include
	mkdir -p mylib/lib
	cp *.h mylib/include
	cp  -p *.a *.so mylib/lib

